package com.wngz.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@NoArgsConstructor
@AllArgsConstructor
//@TableName("tbl_user")
public class User {
    private Long id; //注：id是long类型
    private String name;

    @TableField("pwd")
    private String password;
    private Integer age;

    @TableField(select = false)
    private String tel;

    @TableField(exist = false) //这一列不参与查询
    private Integer online;

//    @TableLogic(delval = "1", value = "0") //这是一个逻辑删除的字段
    private Integer deleted = 0;

    @Version  //这个字段用于版本控制
    private Integer version = 0;

    @TableField(fill = FieldFill.INSERT)  //在插入操作的时候填充
    private Date createTime;  //创建时间
    @TableField(fill = FieldFill.INSERT_UPDATE)  //在插入和更新时填充
    private Date updateTime;  //更新时间
}

